
function getSingleRootURL(path) {
  return {
    path:path,
    children:[]
  }
}

function getShelfUrl(path,title) {

  return {
    path:path,
    title:title
  }

}


function getQuanxian() {

  var qxUrls = Array();

  qxUrls.push(getShelfUrl('/quanxian/userList','员工增删'));
  qxUrls.push(getShelfUrl('/quanxian/roleList','角色/职位增删'));
  // qxUrls.push(getShelfUrl('/quanxian/actionList','功能管理'));
  qxUrls.push(getShelfUrl('/quanxian/historyList','操作日志'));
  qxUrls.push(getShelfUrl('/quanxian/terminalMark','员工终端录入'));
  qxUrls.push(getShelfUrl('/quanxian/employeeTerminal','员工终端权限'));

  return {
    title:'员工权限管理',
    path:'/quanxian',
    icon:'md-people',
    color:'#2196f3',
    children:qxUrls
  };


}

function getUser() {
  var userUrls = Array();

  userUrls.push(getShelfUrl('/user/userSearch','用户查询'));
  userUrls.push(getShelfUrl('/user/userList','公众用户管理'));
  // userUrls.push(getShelfUrl('/user/userVerify','用户审核（已自动）'));
  // userUrls.push(getShelfUrl('/user/userCustomer','注册用户分配'));
  // userUrls.push(getShelfUrl('/user/userEmployee','用户推广员工'));

  return {
    title:'用户管理',
    path:'/user',
    icon:'md-contacts',
    color:'#009685',
    children:userUrls
  };

}
function getChat() {
  let chatUrls = Array();

  // chatUrls.push(getShelfUrl('/chat/userMessage','消息推送'));
  chatUrls.push(getShelfUrl('/chat/chatMessage','LiveChat 会话'));
  chatUrls.push(getShelfUrl('/chat/workbench','LiveChat 工作台'));
  chatUrls.push(getShelfUrl('/chat/customerService','座席管理'));

  return {
    title:'Live Chat',
    path:'/chat',
    icon:'md-chatbubbles',
    color:'#009685',
    children:chatUrls
  };

}

function getCollections(){

  let collection = Array();
  collection.push(getShelfUrl('/collection/list','集合列表'));
  return {
    title:'产品集合',
    path:'/collection',
    icon:'md-briefcase',
    color:'#009685',
    children:collection
  };

}

function getStands(){

  let collection = Array();
  collection.push(getShelfUrl('/stands/list','展厅列表'));
  collection.push(getShelfUrl('/stands/initWebPage','PC页面初始化'));
  // collection.push(getShelfUrl('/stands/modify','展厅编辑'));

  return {
    title:'展厅管理',
    path:'/stands',
    icon:'md-briefcase',
    color:'#009685',
    children:collection
  };

}


function getProduct() {
  var productUrls = Array();

  productUrls.push(getShelfUrl('/product/list','产品管理'));
  productUrls.push(getShelfUrl('/product/classification','分类管理'));
  productUrls.push(getShelfUrl('/product/tag','产品角标管理'));
  productUrls.push(getShelfUrl('/product/listSysSizes','系统默认尺码'));
  // productUrls.push(getShelfUrl('/product/productClassification','分类批量维护'));
  // productUrls.push(getShelfUrl('/product/tagBatch','标签批量维护'));
  productUrls.push(getShelfUrl('/product/recycle','产品回收站'));
  // productUrls.push(getShelfUrl('/product/stockEmptyColor','无库存色卡'));
  productUrls.push(getShelfUrl("/product/manageTagMapping", "产品批量增删标签"));
  productUrls.push(getShelfUrl('/product/delete','清理下架产品'));


  return {
    title:'产品管理',
    path:'/product',
    icon:'md-basket',
    color:'#ff9800',
    children:productUrls
  };

}

function getProductSource() {
  let productUrls = Array();
  productUrls.push(getShelfUrl('/productSource/summary','排查进度汇总'));
  productUrls.push(getShelfUrl('/productSource/statistics','员工排查统计'));
  productUrls.push(getShelfUrl('/productSource/soldOut','已下架货源'));

  return {
    title:'货源排查',
    path:'/productSource',
    icon:'md-barcode',
    color:'#ff9800',
    children:productUrls
  };
}

function getOrder() {
  var orderUrls = Array();

  orderUrls.push(getShelfUrl('/order/orderList','订单管理'));
  orderUrls.push(getShelfUrl('/order/orderRefund','订单售后管理'));
  orderUrls.push(getShelfUrl('/order/shortageRefund','订单退款管理'));
  orderUrls.push(getShelfUrl('/order/firstOrder','用户首单'));
  orderUrls.push(getShelfUrl('/order/orderCuorierList','物流发货管理'));



  return {
    title:'订单管理',
    path:'/order',
    icon:'ios-list-box',
    color:'#00bcd4',
    children:orderUrls
  };
}

function getNewOrder(){

  var orderUrls = Array();

  orderUrls.push(getShelfUrl('/order-new/orderList','新订单列表'));
  // orderUrls.push(getShelfUrl('/order-new/shipping','拆单发货'));

  orderUrls.push(getShelfUrl('/order-new/paymentAndSafe','款项和安全确认'));

  return {
    title:'新订单中心',
    path:'/order-new',
    icon:'ios-list-box',
    color:'#00bcd4',
    children:orderUrls
  };
}


function getBlog(){
  var blogUrls = Array();
  blogUrls.push(getShelfUrl('/blog/bloglist','Docs列表'));
  return {
    title:'Docs管理',
    path:'/blog',
    icon:'ios-document',
    color:'#00bcd4',
    children:blogUrls
  };
}

function getSEOList(){
  var seoURLS = Array();
  seoURLS.push(getShelfUrl('/seo/seolist','页面列表'));
  return {
    title:'SEO设置',
    path:'/seo',
    icon:'ios-compass',
    color:'#00bcd4',
    children:seoURLS
  };
}


function getImage() {
  var couponUrls = Array();

  couponUrls.push(getShelfUrl('/image','图片管理'));

  return {
    title:'图片管理',
    path:'/image',
    icon:'ios-images',
    color:'#ff5722',
    children:couponUrls
  };
}

function getCoupon() {
  var couponUrls = Array();

  couponUrls.push(getShelfUrl('/coupon/couponModelList','优惠券模板'));
  couponUrls.push(getShelfUrl('/coupon/couponDetailList','优惠券详情'));
  couponUrls.push(getShelfUrl('/coupon/distributeCoupons','发放VIP优惠券'));

  return {
    title:'优惠券',
    path:'/coupon',
    icon:'md-pricetags',
    color:'#795548',
    children:couponUrls
  };
}


function getOthers() {
  var otherUrls = Array();

  otherUrls.push(getShelfUrl('/other/countryList','开放国家管理'));
  otherUrls.push(getShelfUrl('/other/postage','运费规则管理'));
  otherUrls.push(getShelfUrl('/other/countryPostage','国家运费管理'));
  otherUrls.push(getShelfUrl('/other/configArgs','在线参数管理'));
  otherUrls.push(getShelfUrl('/other/appVersion','APP版本管理'));
  otherUrls.push(getShelfUrl('/other/deliveryCompany','物流追踪API'));
  otherUrls.push(getShelfUrl('/other/searchKeyword','搜索推荐管理'));
  otherUrls.push(getShelfUrl('/manageTab/list', '后台管理标签'));
  otherUrls.push(getShelfUrl('/other/paymentAccountList', '支付平台账户'));
  otherUrls.push(getShelfUrl('/other/wireTransferDesc/list', '线下支付说明'));

  return {
    title:'其他管理',
    path:'/other',
    icon:'ios-construct',
    color:'#607d8b',
    children:otherUrls
  };
}


function getUtils() {
  var utilUrls = Array();

  // utilUrls.push(getShelfUrl('/operations/userImport','目标用户导入与解析'));
  utilUrls.push(getShelfUrl('/operations/targetCustomerList','独立站分配'));
  utilUrls.push(getShelfUrl('/operations/targetCustomerManege','独立站管理'));
  utilUrls.push(getShelfUrl('/operations/invalidCustomer','无效独立站'));
  utilUrls.push(getShelfUrl('/operations/sameWebsiteCustomer','独立站查重'));

  return {
    title:'独立站推广',
    path:'/operations',
    icon:'ios-archive',
    color:'#ffc107',
    children:utilUrls
  };
}



function getAnalysis() {
  var analysisUrls = Array();

  // analysisUrls.push(getShelfUrl('/analysis/cycleReport','周报数据'));
  analysisUrls.push(getShelfUrl('/analysis/orderUserCollectAnalysis','统计图表'));
  analysisUrls.push(getShelfUrl('/analysis/productOrder','产品订单量统计'));
  analysisUrls.push(getShelfUrl('/analysis/cart','购物车统计'));
  // analysisUrls.push(getShelfUrl('/analysis/productDetail','产品详情访问量统计'));
  analysisUrls.push(getShelfUrl('/analysis/keyWord','搜索关键词统计'));
  analysisUrls.push(getShelfUrl('/analysis/userDaily','每日用户数据'));
  analysisUrls.push(getShelfUrl('/analysis/productDaily','每日产品数据'));
  analysisUrls.push(getShelfUrl('/analysis/userAnalysis','用户行为统计分析'));
  analysisUrls.push(getShelfUrl('/analysis/dailyStatisticFail','每日数据统计异常记录'));


  return {
    title:'统计分析',
    path:'/analysis',
    icon:'ios-pie',
    color:'#00e676',
    children:analysisUrls
  };
}

function getEmail() {
  let emailUrls = Array();

  emailUrls.push(getShelfUrl('/email/list','收件箱'));
  emailUrls.push(getShelfUrl('/email/sendEmailList','发件箱'));
  emailUrls.push(getShelfUrl('/email/addressBookList','通讯录'));
  emailUrls.push(getShelfUrl('/email/blacklist','黑名单'));
  emailUrls.push(getShelfUrl('/email/trashEmail','垃圾邮件'));
  emailUrls.push(getShelfUrl('/email/listSys','系统邮件收件箱'));
  emailUrls.push(getShelfUrl('/email/sendEmailListSys','系统邮件发件箱'));
  emailUrls.push(getShelfUrl('/email/failEmail','失败邮件'));
  emailUrls.push(getShelfUrl('/contactEmail/contactUserList','待开发用户'));
  emailUrls.push(getShelfUrl('/contactEmail/emailTemplateList','邮件模板'));
  return {
    title:'邮件管理',
    path:'/email',
    icon:'ios-mail',
    color:'#ffc107',
    children:emailUrls
  };
}


function getImpProduct() {
  let impProductUrls = Array();

  impProductUrls.push(getShelfUrl('/impProduct/imagesUpload', '图片批量上传'));
  impProductUrls.push(getShelfUrl('/impProduct/check', '采集检查'));
  // impProductUrls.push(getShelfUrl('/impProduct/add', '选品录入'));
  // impProductUrls.push(getShelfUrl('/impProduct/caiji', '采集产品'));
  impProductUrls.push(getShelfUrl('/impProduct/list', '审核产品'));
  impProductUrls.push(getShelfUrl('/impProduct/import', '导入正式库'));
  impProductUrls.push(getShelfUrl('/impProduct/onSale', '审核上架'));
  impProductUrls.push(getShelfUrl('/impProduct/suppliers', '供货商管理'));
  impProductUrls.push(getShelfUrl('/impProduct/categories', '采集分类管理'));

  return {
    title: '产品采集',
    path: '/impProduct',
    icon: 'ios-basket',
    color: '#ffc107',
    children: impProductUrls,
  }
}

 function getRouterUrls() {

  let rootUrls = Array();

  // 根路径公共页面
  // rootUrls.push(getSingleRootURL('/index'));
  rootUrls.push(getSingleRootURL('/login'));
  rootUrls.push(getSingleRootURL('/error'));

  //各个模块和子页面
  let moudleUrls = Array();
  moudleUrls.push(getQuanxian());
  moudleUrls.push(getUser());
  moudleUrls.push(getChat());
  moudleUrls.push(getProduct());
   moudleUrls.push(getProductSource());
  moudleUrls.push(getStands());
  moudleUrls.push(getOrder());
   moudleUrls.push(getNewOrder());
   moudleUrls.push(getBlog());
   moudleUrls.push(getImpProduct());
  moudleUrls.push(getCoupon());
  moudleUrls.push(getImage());
  moudleUrls.push(getUtils());
  moudleUrls.push(getEmail());
   moudleUrls.push(getSEOList());
  moudleUrls.push(getOthers());
  moudleUrls.push(getAnalysis());


  return {
    Root:rootUrls,
    Moudle:moudleUrls
  };


};

const RouterUrls =  getRouterUrls();

export default RouterUrls;


